package com.ruoyi.yuwen.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yuwen.mapper.UserGoodsMapper;
import com.ruoyi.yuwen.domain.UserGoods;
import com.ruoyi.yuwen.service.IUserGoodsService;

/**
 * 用户商品库存Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-03-19
 */
@Service
public class UserGoodsServiceImpl implements IUserGoodsService 
{
    @Autowired
    private UserGoodsMapper userGoodsMapper;

    /**
     * 查询用户商品库存
     * 
     * @param id 用户商品库存主键
     * @return 用户商品库存
     */
    @Override
    public UserGoods selectUserGoodsById(Long id)
    {
        return userGoodsMapper.selectUserGoodsById(id);
    }

    /**
     * 查询用户商品库存列表
     * 
     * @param userGoods 用户商品库存
     * @return 用户商品库存
     */
    @Override
    public List<UserGoods> selectUserGoodsList(UserGoods userGoods)
    {
        return userGoodsMapper.selectUserGoodsList(userGoods);
    }

    /**
     * 新增用户商品库存
     * 
     * @param userGoods 用户商品库存
     * @return 结果
     */
    @Override
    public int insertUserGoods(UserGoods userGoods)
    {
        return userGoodsMapper.insertUserGoods(userGoods);
    }

    /**
     * 修改用户商品库存
     * 
     * @param userGoods 用户商品库存
     * @return 结果
     */
    @Override
    public int updateUserGoods(UserGoods userGoods)
    {
        return userGoodsMapper.updateUserGoods(userGoods);
    }

    /**
     * 批量删除用户商品库存
     * 
     * @param ids 需要删除的用户商品库存主键
     * @return 结果
     */
    @Override
    public int deleteUserGoodsByIds(Long[] ids)
    {
        return userGoodsMapper.deleteUserGoodsByIds(ids);
    }

    /**
     * 删除用户商品库存信息
     * 
     * @param id 用户商品库存主键
     * @return 结果
     */
    @Override
    public int deleteUserGoodsById(Long id)
    {
        return userGoodsMapper.deleteUserGoodsById(id);
    }

    @Override
    public int deleteUserGoodsByGoodsIds(Long[] goodsIds) {
        return userGoodsMapper.deleteUserGoodsByGoodsIds(goodsIds);
    }
}
